{-# OPTIONS -Wall #-}

module Demo01 where

import Main
import DirectoryDiff.Compare
import DirectoryDiff.ParserCombinators
import DirectoryDiff.ResolvedSyntax
import DirectoryDiff.WindowsParser

import Control.Applicative
import Data.Monoid

import qualified Data.Set as S


demo01 = main2 [] [ "input/ParadiseGreenWPS.old.txt"
                  , "input/ParadiseGreenWPS.new.txt" ] []
demo02 = main2 [] ["input/haskell-libs.txt"] []

demo03 = do 
    a1 <- toplevelsFromFile "input/metrics.txt"
    case a1 of
      Left err -> error err
      Right xs -> either error sk $ resolve xs
  where
    sk r = do { putStrLn $ show (dirNames r); putStrLn $ show (fileNames r) }


test01 :: S.Set Int
test01 = s1 S.\\ s2
  where
    s1 = S.fromList [1..10]
    s2 = S.fromList [4..12]

test02 :: S.Set Int
test02 = s1 `S.difference` s2
  where
    s1 = S.fromList [1..10]
    s2 = S.fromList [4..12]


test03 = sameWithIns a b "\\Current"
  where
    a = "\\LOI\\Current\\SAI00490107_PARADISE GRN_PUMP CTRL_V3_02.PBA"
    b = "\\LOI\\SAI00490107_PARADISE GRN_PUMP CTRL_V3_02.PBA"


test04 = sameWithIns a b "\\Current"
  where
    a = "\\LOI\\Current\\SAI00490107_PARADISE GRN_PUMP CTRL_V3_02.PBA"
    b = "\\LOI\\SAI00490107_PARADISE GRN_PUMP CTRL_V3_09.PBA"